Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Remove model namespace #703

Closed
wants to merge 3 commits into from
Closed

Conversation

jbelkins
Copy link
Contributor

Issue #

awslabs/aws-sdk-swift#1458

Description of changes

Removes the namespace around nested model types to reduce boilerplate and simplify service clients. Results in the following changes to a service's models:

  • Input and output structures are renamed to end in OperationInput and OperationOutput (to resolve name collision with a couple services that have names that clash with the current Input and Output names.)
  • Model types that are not top-level (i.e. in a property or sub-property of an input, output, or error) are no longer namespaced to ServiceClientTypes and are created in the root namespace of the service.
  • Error structures are unchanged.

Specific changes made to support:

  • The NestedTrait and the transformer that applies it are removed, since no models are nested anymore.
  • Removes code that renders models and their extensions in a namespace.
  • Fixes many references to runtime types so that they use the fully qualified name, to avoid unresolvable ambiguity with modeled types of the same name.
  • Changes the name of input / output type name suffix from Input and Output to OperationInput and OperationOutput. This was needed to avoid name collisions after renaming.

Note: Many codegen tests are broken due to changed names. Will fix once we settle on naming structure.

Scope

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jbelkins
Copy link
Contributor Author

Will have to investigate this further before deciding on an approach. Closing this PR but preserving the branch for potential future use.

@jbelkins jbelkins closed this May 10, 2024
@jbelkins jbelkins deleted the jbe/remove_model_namespace branch November 20, 2024 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant